<!DOCTYPE html>

<html>
<head>
  <title>添加文章 - 我的 beego 播客</title>
  {{template "header"}}
</head>

<body style="padding-top: 70px">
  <!-- 导航栏 -->
  {{template "navbar" .}}

  <!-- 内容 -->
  <div class="container">
    <h2>添加文章</h2>
    <form method="post" action="/topic" enctype="multipart/form-data">

      <div class="form-group">
        <label>文章标题：</label>
        <input type="text" name="title" class="form-control">
      </div>

  
      <div class="form-group">
        <label>文章分类</label>
        <input type="text" class="form-control" name="category">
      </div>

      <div class="form-group">
        <label>文章标签</label>
        <input type="text" class="form-control" name="label">
      </div>

      <div class="form-group">
        <label>文章附件</label>
        <input type="file" class="form-control" name="attachment">
      </div>

      <div>
        <label>文章内容</label>
        <textarea name="content" cols="30" rows="20" class="form-control"></textarea>
      </div>

      <button type="submit" class="btn btn-default">添加文章</button>
    </form>

  </div>

  <!-- 导入bootstrap js插件 -->
  <script type="text/javascript" src="https://cdn.staticfile.org/jquery/3.2.1/jquery.min.js"></script>
  <script type="text/javascript" src="/static/js/bootstrap.min.js"></script>
  <script type="text/javascript">
    function checkInput() {
     var title = document.getElementById("title");
     if (title == undefined || title == "") {
      window.alter("请输入标题！");
      return false;
    }
    var content = document.getElementById("content");
    if (content == undefined || content == "") {
      window.alter("请输入内容名称！");
      return false;
    }
  }
</script>
</body>
</html>